import { navData } from '@/untils/nav'
import { createRouter, createWebHashHistory } from 'vue-router'
// import Event from '@/views/event/index.vue'
// import Report from '@/views/report/index.vue'
// import Loading from '@/components/Loading.vue'
// import LoadingX from '@/components/LoadingX.vue'
// import Reverse from '@/components/Reverse.vue'
// import LoadingVerify from '@/components/LoadingVerify.vue'

const routes = [
  { path: '/', redirect: '/report' },
  { id:1,name:'Report',title:'组件通信',path: '/report', component: '@/views/report/index.vue' },
]

navData.forEach((element)=>{
  routes.push({
    id:element.id,
    name:element.name,
    title:element.title,
    path:element.path,
    component:()=>import('@/'+element.component)
  })
})

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
